Practical LR Error Recoveryt

نویسندگان

  • Susan L. Graham
  • Charles B. Haley
  • William N. Joy
  • W. N. Joy
چکیده

We present a practical, language independent mechanism for error recovery in LR parsers. The method is easy to implement in existing parser generators. It uses only the normal parse tables and a small amount of symbol cost information. It is possible to use compressed parse tables with the method, as well as other LR augmentations such as precedence and associativity declarations. The method is efficient enough to be used in environments where space and time are at a premium. Our method utilizes a number of previous error recovery ideas: forward moves in the input after detection of errors to incorporate right context, recovery choice based on weighted costs, and the use of special productions to indicate major productions in the grammar for error recovery. The method also makes use of semantic information in choosing between possible recovery actions. We have implemented the method in a production Pascal translator which has been in use for instruction at a number of universities for two years. We report here on measurements of our system on a standard data base of Pascal programs with errors.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Minimum Distance Error Correction

A method is presented for incorporating error correction using a minimum distance measure into LR parsers. The method is suitable for use by an automatic parser-generator. State information in the LR parser stack at the point of detection of error is used to generate a set of strings which are potential repairs to the input. A string with least minimum distance from the actual input is chosen a...

متن کامل

LR(1) Parser Generator Hyacc

The space and time cost of LR parser generation is high. Robust and effective LR(1) parser generators are rare to find. This work employed the Knuth canonical algorithm, Pager’s practical general method, lane-tracing algorithm, and other relevant algorithms, implemented an efficient, practical and open-source parser generator Hyacc in ANSI C, which supports full LR(0)/LALR(1)/LR(1) and partial ...

متن کامل

How To Obtain Powerful Parsers That Are Elegant and Practical

Most of the functional parsers published today focus on elegance. But they pay for this elegance by neglecting practical requirements such as efficiency and decent error handling. By contrast, a traditional parser (generator) based on LLor LR-principles focuses on efficiency and neglects issues such as elegance and understandability almost entirely. In this paper we combine these pragmatic issu...

متن کامل

Toward Modular Implementation of Practical Identifier Completion on Incomplete Program Text

Identifier completion is a widely-used functionality in IDEs like Eclipse and editors like Emacs and vi. In this paper we present how to implement identifier completion for a core of functional languages with a focus on coping with incomplete program text based on error recovery in LR parsing. We believe the present work is a first step toward building practical identifier completion in IDEs fo...

متن کامل

A Practical Minimum Distance Method for Syntax Error Handling

Original citation: Dain, J. A. (1992) A practical minimum distance method for syntax error handling. Copyright and reuse: The Warwick Research Archive Portal (WRAP) makes this work by researchers of the University of Warwick available open access under the following conditions. Copyright © and all moral rights to the version of the paper presented here belong to the individual author(s) and/or ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2000